import { computed } from "vue"
import { useStore,mapGetters } from "vuex"
import { onShow } from "@dcloudio/uni-app"

export function useShowNum(){
  
    let store = useStore()
    let total = computed(()=>{   //store里的计算属性
      return store.getters.total
    })

    onShow(()=>{
      uni.setTabBarBadge({
        index: 2,
        text: total.value + ''
      })
    })
    
    return store

}